<include file="Public/header" />
<title>添加账册</title>
</head>
<body>
<div class="pd-20">
<form action="__URL__/add_goods" name="postForm" id="postForm" enctype="multipart/form-data" method="post" >
	<table class="table table-border table-bordered table-bg">
		<input type="hidden" name="id" class="input-text" value="<{$detail.id}>">
				<tbody>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">商品名称</td>
				<td class="text-l" width="35%">
					<input type="text" name="goods_name" class="input-text" value="<{$detail.goods_name}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">商品编码</td>
				<td class="text-l">
					<input type="text" name="goods_no" class="input-text" value="<{$detail.goods_no}>" >
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">品牌</td>
				<td class="text-l" width="35%">
					<input type="text" name="goods_brand" class="input-text" value="<{$detail.goods_brand}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">型号</td>
				<td class="text-l">
					<input type="text" name="goods_marque" class="input-text" value="<{$detail.goods_marque}>" >
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">缩略图</td>
				<td class="text-l" width="35%">
					<input type="file" name="goods_pic" class="input-text" value="<{$detail.goods_pic}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">商品价格</td>
				<td class="text-l">
					<input type="text" name="price" class="input-text" value="<{$detail.price}>" >
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">数量</td>
				<td class="text-l" width="35%">
					<input type="text" name="receive_amount" class="input-text" value="<{$detail.receive_amount}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">税率(%)</td>
				<td class="text-l">
					<input type="text" name="goods_tax" class="input-text" value="<{$detail.goods_tax}>" >
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">条形码</td>
				<td class="text-l" width="35%">
					<input type="text" name="bar_code" class="input-text" value="<{$detail.bar_code}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">料号</td>
				<td class="text-l">
					<input type="text" name="source_no" class="input-text" value="<{$detail.source_no}>" >
				</td>				
			</tr>
			<tr class="text-c">
				<td width="15%" class="text-r" style="background-color:#f5f5f5">净重</td>
				<td class="text-l" width="35%">
					<input type="text" name="net_weight" class="input-text" value="<{$detail.net_weight}>" >
				</td>
				<td width="15%" class="text-r" style="background-color:#f5f5f5">毛重</td>
				<td class="text-l">
					<input type="text" name="gross_weight" class="input-text" value="<{$detail.gross_weight}>" >
				</td>				
			</tr>
		</tbody>
	</table>
	<input type="button" class="btn btn-primary radius mt" id="b_add" value="更新">
</form>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	$("#b_add").click(function() { 
        $("#postForm").ajaxSubmit({  
            url: "<{:U('add_goods')}>",
            type : "post",  
            dataType : 'json',  
            success : function(data) {
				if(data.status==1){
					layer.msg(data.message,function(){
						parent.window.location.href =parent.window.location.href;
					});
				}else{
					layer.msg(data.message);
				}
                
            },  
            error : function(data) {  
                layer.msg('出错');
            }  
        });  
    });

</script>
</body>
</html>